<?php

declare(strict_types=1);

/**
 * @Author:     Frank
 * @contact     frank_hhm@163.com
 * @Date:       2023-02-16 13:57:39
 * @Last Modified time: 2023-02-16 14:11:04
 */
namespace addon\wechat\enum;

use frank\base\BaseEnum;

/**
 * 枚举类
 * Class RefundEnum
 * @package addon\wechat\enum
 */
class RefundEnum extends BaseEnum
{
    // 退款成功
    const SUCCESS = 'SUCCESS';

    // 退款关闭
    const CLOSED = 'CLOSED';

    // 退款异常
    const ABNORMAL = 'ABNORMAL';

    /**
     * 获取枚举数据
     * @return array
     */
    public static function data($key = null)
    {
    	$data = [
            self::SUCCESS => [
                'name' => '退款成功',
                'value' => self::SUCCESS,
                '_value' => 1,
            ],
            self::CLOSED => [
                'name' => '退款关闭',
                'value' => self::CLOSED,
                '_value' => 2,
            ],
            self::ABNORMAL => [
                'name' => '退款异常',
                'value' => self::ABNORMAL,
                '_value' => 4,
            ],
        ];
        if(!is_null($key) && isset($data[$key])){
        	return $data[$key];
        }
        return $data;
    }
}
